<?php Session::Set("URLSENDMAIL", "index.php?" . $_SERVER['QUERY_STRING']);?>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="list">
<tbody>
   <tr>
  	<td colspan="9">
  		<fieldset style='border:1px solid #afe14c;margin: 7px 0;padding: 10px 10px'>
  		<legend style='font: 700 14px Arial, Helvetica, sans-serif;padding: 0 5px;margin: 0 10px;color: #73b304'>Nhập thông tin tìm kiếm account</legend>
  		<form id="form2" name="form2" method="post" action="index.php?m=user&a=search<?php echo constants::$pathUrl;?>">
		  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
		    <tr>
		      <th width="300" align="right">&nbsp;&nbsp;Tên khách hàng :<input size="24" type="text" name="hoten" id="hoten" value="<?php echo $this->getPost['hoten'];?>"/></th>
		      <th align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email :<input size="35" type="text" name="email" id="email" value="<?php echo $this->getPost['email'];?>"/></th>
		    </tr>
		    <tr>
		      <th width="300" align="right">&nbsp;&nbsp;Nick name :<input size="28" type="text" name="nickname" id="nickname" value="<?php echo $this->getPost['nickname'];?>"/></th>
		      <th align="left">&nbsp;&nbsp;Số điện thoại :<input size="17" type="text" name="phone" id="phone" value="<?php echo $this->getPost['phone'];?>"/></th>
		    </tr>
		    <tr>
		      <td width="300" align="right"><input type="submit" name="SubSearch" value="Tìm kiếm" /></td>
		      <td>&nbsp;</td>
		    </tr>
		  </table>
		</form>
		</fieldset>
	</td>
  </tr>
  <form name="form1" id="form1" action="" method="post" enctype="multipart/form-data">
  <input type="hidden" name="itemID" value="" />
  <input type="hidden" name="mode" value="" />
  <input type="hidden" name="type" value="" />
  <tr>
    <th width="2%" class="color-tr-td border-top border-left"><span onclick="checkAll()">Check</span><br><span onclick="uncheckAll()">Uncheck</span></th>
    <th width="2%" class="color-tr-td border-top border-left">STT</th>
    <th width="15%" class="color-tr-td border-top border-left"><span style="cursor:pointer;" onclick="hrefLocation('index.php?m=user&a=<?php echo ($this->getGet['type']=='s') ? "search" : "index";?>&sort=hoten&value=<?php echo ($this->valueSort=='DESC') ? "ASC" : "DESC";?>', '', '<?php echo constants::$pathUrl;?>#content')">Họ Tên</span></th>
    <th width="10%" class="color-tr-td border-top border-left"><span style="cursor:pointer;" onclick="hrefLocation('index.php?m=user&a=<?php echo ($this->getGet['type']=='s') ? "search" : "index";?>&sort=phone&value=<?php echo ($this->valueSort=='DESC') ? "ASC" : "DESC";?>', '', '<?php echo constants::$pathUrl;?>#content')">Phone</span></th>
    <th width="15%" class="color-tr-td border-top border-left"><span style="cursor:pointer;" onclick="hrefLocation('index.php?m=user&a=<?php echo ($this->getGet['type']=='s') ? "search" : "index";?>&sort=nickname&value=<?php echo ($this->valueSort=='DESC') ? "ASC" : "DESC";?>', '', '<?php echo constants::$pathUrl;?>#content')">NickName</span></th>
    <th width="5%" class="color-tr-td border-top border-left">Reset<br>Pass</th>
    <th width="15%" class="color-tr-td border-top border-left"><span style="cursor:pointer;" onclick="hrefLocation('index.php?m=user&a=<?php echo ($this->getGet['type']=='s') ? "search" : "index";?>&sort=email&value=<?php echo ($this->valueSort=='DESC') ? "ASC" : "DESC";?>', '', '<?php echo constants::$pathUrl;?>#content')">Email</span></th>
    <th width="15%" class="color-tr-td border-top border-left"><span style="cursor:pointer;" onclick="hrefLocation('index.php?m=user&a=<?php echo ($this->getGet['type']=='s') ? "search" : "index";?>&sort=insert_at&value=<?php echo ($this->valueSort=='DESC') ? "ASC" : "DESC";?>', '', '<?php echo constants::$pathUrl;?>#content')">Ngày<br>Tham Gia</span></th>
    <th class="color-tr-td border-top border-left border-right">DEL</th>
   </tr>
   <?php if (count ($this->arrContent) > 0) {
   		$i=0;
   		foreach ($this->arrContent as $arrContent) {
   ?>
	   <tr class="<?php if ($i%2==0) echo 'blue'; else echo 'white'; ?>">
	     <td align="center" class="border-top border-left"><input type="checkbox" name="emailA[]" value="<?php echo $arrContent['email'];?>" /></td>
	     <td align="center" class="border-top border-left"><?php echo ($i + 1);?></td>
	     <td align="left" class="border-top border-left"><?php echo ($arrContent['hoten']!='' ? $arrContent['hoten'] : 'Đang cập nhật');?></td>
	     <td align="center" class="border-top border-left"><?php echo $arrContent['phone'];?></td>
	     <td style="cursor:pointer;" align="left" class="border-top border-left" onclick="frmSubmit('m=user&a=edit<?php echo constants::$pathUrl;?>', '<?php echo $arrContent['id']; ?>', '', '')"><?php echo $arrContent['nickname'];?></td>
	     <td align="center" class="border-top border-left"><span id="resetPass_<?php echo $arrContent['id'];?>"><img width="18" onclick="if(comfornResetPass()){resetPass('<?php echo $arrContent['id'];?>', '<?php echo constants::$pathUrl;?>')}" src="images/default/capnhat.png"></span></td>
	     <td align="left" class="border-top border-left"><span onclick="hrefLocation('index.php?m=user&a=sendmail&mail=', '<?php echo $arrContent['email'];?>', '<?php echo constants::$pathUrl;?>')"><?php echo $arrContent['email'];?></span></td>
	     <td align="center" class="border-top border-left"><?php echo $arrContent['insert_at'];?></td>
	     <td align="center" class="border-top border-left" <?php if ($this->dataUser['quyen'] == 0){?> onclick="if(cfdelete()){frmSubmit('m=user<?php echo constants::$pathUrl;?>', '<?php echo $arrContent['id']; ?>', 'delete', '');}" <?php }?>><img src="images/default/b_usrdrop.png" /></td>
	   </tr>
   <?php 
   		$i++;
   		}
   ?>
   	   <tr>
   	   		<td class="border-top">&nbsp;</td>
   	   		<td class="border-top">&nbsp;</td>
   	   		<td class="border-top">&nbsp;</td>
   	   		<td class="border-top">&nbsp;</td>
   	   		<td class="border-top">&nbsp;</td>
   	   		<td class="border-top">&nbsp;</td>
   	   		<td class="border-top">&nbsp;</td>
   	   		<td class="border-top">&nbsp;</td>
   	   		<td class="border-top">&nbsp;</td>
   	   </tr>
   <?php 
   }
   ?>
   <tr>
     <td colspan="9" width="5%" align="left" class="color-tr-td"><span style="border:1px solid #CCC;padding:3px 5px;cursor:pointer;font-weight:bold;" onclick="frmSubmit('m=user&a=sendmail<?php echo constants::$pathUrl;?>', '', 'sendmail', '')">Send mail</span></td>
    </tr>
   <tr>
   		<td colspan="9" align="center"><table border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td align="right">
					<?php
					if( $this->currPage > 1 ) {
						echo "<a href='index.php?m=user&a=" . (($this->getGet['type']=='s') ? 'search' : 'index') . $this->strSort . "&pageNo=".($this->currPage-1). constants::$pathUrl . "#content'><span>Prev</span></a>&nbsp;&nbsp;";
					}
					?>
					</td>
					<td align="center">
					<?php
					if ($this->numberPage > 1) {
					?>
					  <table border="0" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td height="15">&nbsp;&nbsp;<?php echo $this->strPaging; ?>&nbsp;&nbsp;</td>
								</tr>
							</tbody>
						</table>
					<?php } ?>
					</td>
					<td align="left">
					<?php
					if ($this->currPage < $this->numberPage) {
						echo "&nbsp;&nbsp;<a href='index.php?m=user&a=" . (($this->getGet['type']=='s') ? 'search' : 'index') . $this->strSort . "&pageNo=".($this->currPage+1). constants::$pathUrl . "#content'><span>Next</span></a>";
					} 
					?>
					</td>
				</tr>
			</table>
        </td>
   </tr>
   </form>
</tbody>
</table>